home *** CD-ROM | disk | FTP | other *** search
/ Aminet 34 / Aminet 34 (2000)(Schatztruhe)[!][Dec 1999].iso / Aminet / dev / misc / WHDLoad_dev.lha / WHDLoad / Src / programs / SP.asm < prev    next >
Encoding:
Assembly Source File  |  1999-03-16  |  12.8 KB  |  736 lines

  1. ;*---------------------------------------------------------------------------
  2. ;  :Program.    sp.asm
  3. ;  :Contents.    saves iff picture form dump file created by WHDLoad
  4. ;  :Author.    Bert Jahn
  5. ;  :EMail.    wepl@kagi.com
  6. ;  :Address.    Franz-Liszt-Straße 16, Rudolstadt, 07404, Germany
  7. ;  :Version.    $Id: SP.asm 1.2 1999/03/16 14:09:30 jah Exp jah $
  8. ;  :History.    13.07.98 started
  9. ;        03.08.98 reworked for new dump file
  10. ;        12.10.98 cskip added
  11. ;        17.01.99 recompile because error.i changed
  12. ;        15.03.99 cop/k and width/k added
  13. ;  :Requires.    OS V37+
  14. ;  :Copyright.    © 1998 Bert Jahn, All Rights Reserved
  15. ;  :Language.    68020 Assembler
  16. ;  :Translator.    Barfly 2.9
  17. ;---------------------------------------------------------------------------*
  18. ;##########################################################################
  19.  
  20.     INCDIR    Includes:
  21.     INCLUDE    lvo/exec.i
  22.     INCLUDE    exec/memory.i
  23.     INCLUDE    lvo/dos.i
  24.     INCLUDE    dos/dos.i
  25.     INCLUDE    hardware/custom.i
  26.     
  27.     INCLUDE    whddump.i
  28.     INCLUDE    macros/ntypes.i
  29.  
  30. ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  31.  
  32. GL    EQUR    A4        ;a4 ptr to Globals
  33. LOC    EQUR    A5        ;a5 for local vars
  34.  
  35.     STRUCTURE    ArgArray,0
  36.         ULONG    aa_output
  37.         ULONG    aa_cop
  38.         ULONG    aa_copstop
  39.         ULONG    aa_width
  40.         ULONG    aa_height
  41.         ULONG    aa_con0
  42.         ULONG    aa_mod1
  43.         ULONG    aa_mod2
  44.         ULONG    aa_pt1
  45.         ULONG    aa_pt2
  46.         ULONG    aa_pt3
  47.         ULONG    aa_pt4
  48.         LABEL    aa_SIZEOF
  49.  
  50.     NSTRUCTURE    Globals,0
  51.         NAPTR    gl_execbase
  52.         NAPTR    gl_dosbase
  53.         NAPTR    gl_rdargs
  54.         NSTRUCT    gl_rdarray,aa_SIZEOF
  55.         NALIGNLONG
  56.         NLABEL    gl_SIZEOF
  57.  
  58. ;##########################################################################
  59.  
  60.     PURE
  61.     OUTPUT    C:SP
  62.     SECTION    "",CODE
  63.     MC68020
  64.  
  65. VER    MACRO
  66.         dc.b    "SP 1.1 "
  67.     DOSCMD    "WDate >t:date"
  68.     INCBIN    "t:date"
  69.         dc.b    " by Wepl"
  70.     ENDM
  71.  
  72.         bra    .start
  73.         dc.b    "$VER: "
  74.         VER
  75.         dc.b    " V37+",0
  76.     CNOP 0,2
  77. .start
  78.  
  79. ;##########################################################################
  80.  
  81.         link    GL,#gl_SIZEOF
  82.         move.l    (4).w,(gl_execbase,GL)
  83.         
  84.         move.l    #37,d0
  85.         lea    (_dosname),a1
  86.         move.l    (gl_execbase,GL),a6
  87.         jsr    _LVOOpenLibrary(a6)
  88.         move.l    d0,(gl_dosbase,GL)
  89.         beq    .nodoslib
  90.  
  91.         lea    (_ver),a0
  92.         bsr    _Print
  93.  
  94.         lea    (gl_rdarray,GL),a0
  95.         moveq    #aa_SIZEOF/4-1,d0
  96. .0        clr.l    (a0)+
  97.         dbf    d0,.0
  98.  
  99.         lea    (_template),a0
  100.         move.l    a0,d1
  101.         lea    (gl_rdarray,GL),a0
  102.         move.l    a0,d2
  103.         moveq    #0,d3
  104.         move.l    (gl_dosbase,GL),a6
  105.         jsr    (_LVOReadArgs,a6)
  106.         move.l    d0,(gl_rdargs,GL)
  107.         bne    .argsok
  108.         lea    (_readargs),a0
  109.         bsr    _PrintErrorDOS
  110.         bra    .noargs
  111. .argsok
  112.         bsr    _Main
  113. .opend
  114.         move.l    (gl_rdargs,GL),d1
  115.         move.l    (gl_dosbase,GL),a6
  116.         jsr    (_LVOFreeArgs,a6)
  117. .noargs
  118.         move.l    (gl_dosbase,GL),a1
  119.         move.l    (gl_execbase,GL),a6
  120.         jsr    (_LVOCloseLibrary,a6)
  121. .nodoslib
  122.         unlk    GL
  123.         moveq    #0,d0
  124.         rts
  125.  
  126. ;##########################################################################
  127.  
  128.     NSTRUCTURE    local_main,0
  129.         NAPTR    lm_fileptr
  130.         NULONG    lm_filesize
  131.         NAPTR    lm_header
  132.         NAPTR    lm_cust
  133.         NAPTR    lm_mem
  134.         NULONG    lm_cmapsize
  135.         NULONG    lm_bodysize
  136.         NULONG    lm_destptr
  137.         NSTRUCT    lm_colors,256*3
  138.         NWORD    lm_widthskip        ;amount of bytes which are displayed
  139.                         ;but will not be written to dest
  140.         NALIGNLONG
  141.         NLABEL    lm_SIZEOF
  142.  
  143. _Main        movem.l    d2-d7/a2-a3/a6,-(a7)
  144.         link    LOC,#lm_SIZEOF
  145.         
  146.         lea    (lm_colors,LOC),a0
  147.         moveq    #256*3/8-1,d0
  148. .clr4        clr.l    (a0)+
  149.         clr.l    (a0)+
  150.         dbf    d0,.clr4
  151.  
  152.         lea    (_name),a0
  153.         bsr    _LoadFileMsg
  154.         move.l    d1,(lm_filesize,LOC)
  155.         move.l    d0,(lm_fileptr,LOC)
  156.         beq    .afilefree
  157.  
  158.         clr.l    (lm_mem,LOC)
  159.         clr.l    (lm_cust,LOC)
  160.         clr.l    (lm_header,LOC)
  161.  
  162.         cmp.l    #20,d1
  163.         blt    .filefree
  164.  
  165.         move.l    d0,a0
  166.         cmp.l    #"FORM",(a0)+
  167.         bne    .filefree
  168.         subq.l    #8,d1
  169.         cmp.l    (a0)+,d1
  170.         bne    .filefree
  171.         cmp.l    #ID_WHDD,(a0)+
  172.         bne    .filefree
  173.         subq.l    #4,d1
  174. .idn        move.l    (a0)+,d0
  175.         move.l    (a0)+,d2
  176.         subq.l    #8,d1
  177.         bcs    .filefree
  178.         cmp.l    #ID_CUST,d0
  179.         bne    .id1
  180.         move.l    a0,(lm_cust,LOC)
  181. .id1        cmp.l    #ID_MEM,d0
  182.         bne    .id2
  183.         move.l    a0,(lm_mem,LOC)
  184. .id2        cmp.l    #ID_HEAD,d0
  185.         bne    .id3
  186.         move.l    a0,(lm_header,LOC)
  187. .id3        add.l    d2,a0
  188.         sub.l    d2,d1
  189.         bcs    .filefree
  190.         bne    .idn
  191.  
  192.         tst.l    (lm_mem,LOC)
  193.         beq    .filefree
  194.         tst.l    (lm_cust,LOC)
  195.         beq    .filefree
  196.         tst.l    (lm_header,LOC)
  197.         beq    .filefree
  198.  
  199.         move.l    (lm_header,LOC),a0
  200.         move.l    (wdh_BaseMemSize,a0),-(a7)
  201.         pea    (_mem_text)
  202.         bsr    _pf
  203.         addq.l    #8,a7
  204.  
  205.         move.l    (lm_cust,LOC),a3    ;A3 = custom
  206.  
  207.     ;copy color entries
  208.         lea    (color,a3),a0
  209.         lea    (lm_colors,LOC),a1
  210.         moveq    #31,d0
  211. .sc2        move.w    (a0)+,d1
  212.         bfextu    d1{20:4},d2
  213.         mulu    #$11,d2
  214.         move.b    d2,(a1)+
  215.         bfextu    d1{24:4},d2
  216.         mulu    #$11,d2
  217.         move.b    d2,(a1)+
  218.         bfextu    d1{28:4},d2
  219.         mulu    #$11,d2
  220.         move.b    d2,(a1)+
  221.         dbf    d0,.sc2
  222.  
  223.     ;print coplc's
  224.         movem.l    (cop1lc,a3),d0-d1
  225.         movem.l    d0-d1,-(a7)
  226.         pea    (_cop_text)
  227.         bsr    _pf
  228.         add.w    #12,a7
  229.     ;overwrite with arguments
  230.         move.l    (gl_rdarray+aa_cop,GL),d0
  231.         beq    .ncop
  232.         move.l    d0,a0
  233.         bsr    _etoi
  234.         move.l    d0,(cop1lc,a3)
  235. .ncop
  236.     ;dump copper lists
  237.         bsr    _cdis
  238.     ;move cop writes to custom table
  239.         bsr    _copwrite
  240.  
  241.     ;overwrite with arguments
  242.         bsr    _withargs
  243.  
  244.     ;depth
  245.         bfextu    (bplcon0,a3){1:3},d6
  246.         bne    .3
  247.         moveq    #8,d6            ;D6 = depth
  248. .3
  249.     ;height
  250.         bfextu    (diwstrt,a3){0:8},d0
  251.         bfextu    (diwstop,a3){0:8},d5
  252.         tst.b    d5
  253.         bmi    .4
  254.         add.w    #256,d5
  255. .4        sub.l    d0,d5            ;D5 = height
  256.  
  257.     ;width
  258.     ifeq 1
  259.         bfextu    (diwstrt,a3){8:8},d0
  260.         bfextu    (diwstop,a3){8:8},d4
  261.         add.w    #256,d4
  262.         sub.l    d0,d4            ;D4 = width
  263.     else
  264.         move.w    (ddfstop,a3),d4
  265.         sub.w    (ddfstrt,a3),d4
  266.         addq.w    #8,d4
  267.         add.w    d4,d4            ;D4 = width
  268.     endc
  269.         tst.b    (bplcon0,a3)
  270.         bpl    .lores
  271.         add.w    d4,d4
  272. .lores
  273.         move.l    (gl_rdarray+aa_height,GL),d0
  274.         beq    .h
  275.         move.l    d0,a0
  276.         bsr    _etoi
  277.         move.l    d0,d5
  278. .h
  279.         move.w    d4,(lm_widthskip,LOC)
  280.         move.l    (gl_rdarray+aa_width,GL),d0
  281.         beq    .w
  282.         move.l    d0,a0
  283.         bsr    _etoi
  284.         move.l    d0,d4
  285. .w        move.w    (lm_widthskip,LOC),d0
  286.         sub.w    d4,d0
  287.         asr.w    #3,d0
  288.         move.w    d0,(lm_widthskip,LOC)
  289.  
  290.     ;calc pic size
  291.     ;FORM+ILBM
  292.         moveq    #12,d7
  293.     ;BMHD
  294.         add.l    #28,d7
  295.     ;CAMG
  296.         add.l    #12,d7
  297.     ;CMAP
  298.         moveq    #1,d0
  299.         lsl.l    d6,d0
  300.         mulu    #3,d0
  301.         move.l    d0,(lm_cmapsize,LOC)
  302.         add.l    d0,d7
  303.         addq.l    #8,d7
  304.     ;BODY
  305.         move.l    d4,d0
  306.         add.w    #15,d0
  307.         lsr.l    #4,d0
  308.         add.l    d0,d0
  309.         mulu    d6,d0
  310.         mulu    d5,d0
  311.         move.l    d0,(lm_bodysize,LOC)
  312.         add.l    d0,d7
  313.         addq.l    #8,d7
  314.  
  315.         movem.l    d4-d6,-(a7)
  316.         pea    _dim_text
  317.         bsr    _pf
  318.         add.w    #16,a7
  319.         
  320.         tst.w    d4
  321.         beq    .adestfree
  322.         tst.w    d5
  323.         beq    .adestfree
  324.         tst.w    d6
  325.         beq    .adestfree
  326.  
  327.     ;get mem
  328.         move.l    d7,d0
  329.         moveq    #MEMF_ANY,d1
  330.         move.l    (gl_execbase,GL),a6
  331.         jsr    (_LVOAllocVec,a6)
  332.         move.l    d0,(lm_destptr,LOC)
  333.         bne    .memok
  334.         moveq    #0,d0
  335.         lea    (_nomem),a0
  336.         sub.l    a1,a1
  337.         bsr    _PrintError
  338.         bra    .adestfree
  339. .memok
  340.         move.l    d0,a2
  341.         move.l    #"FORM",(a2)+
  342.         move.l    d7,(a2)
  343.         subq.l    #8,(a2)+
  344.         move.l    #"ILBM",(a2)+
  345.     ;BMHD
  346.         move.l    #"BMHD",(a2)+
  347.         move.l    #20,(a2)+
  348.         move.w    d4,(a2)+
  349.         move.w    d5,(a2)+
  350.         clr.l    (a2)+            ;xpos,ypos
  351.         move.w    d6,d0
  352.         move.b    d0,(a2)+
  353.         clr.b    (a2)+            ;mask
  354.         clr.b    (a2)+            ;compression
  355.         clr.b    (a2)+            ;pad
  356.         clr.w    (a2)+            ;trans col
  357.         move.b    #10,(a2)+        ;x aspect
  358.         move.b    #11,(a2)+        ;y aspect
  359.         move.w    d4,(a2)+        ;screen
  360.         move.w    d5,(a2)+
  361.     ;CAMG
  362.         move.l    #"CAMG",(a2)+
  363.         move.l    #4,(a2)+
  364.         clr.w    (a2)+
  365.         move.w    (bplcon0,a3),(a2)+
  366.     ;CMAP
  367.         move.l    #"CMAP",(a2)+
  368.         move.l    (lm_cmapsize,LOC),d2
  369.         move.l    d2,(a2)+
  370.         lea    (lm_colors,LOC),a0
  371. .cmap        move.w    (a0)+,(a2)+
  372.         subq.l    #2,d2
  373.         bne    .cmap
  374.     ;BODY
  375.         move.l    #"BODY",(a2)+
  376.         move.l    (lm_bodysize,LOC),(a2)+
  377.         moveq    #0,d3            ;d3 = plane
  378.  
  379.         move.w    d5,d3            ;height
  380.  
  381. .9        lea    (bplpt,a3),a0
  382.         move.w    d6,d1            ;depth
  383. .8        move.l    (a0),a1
  384.         add.l    (lm_mem,LOC),a1
  385.         move.w    d4,d0            ;width
  386.         add.w    #15,d0
  387.         lsr.w    #4,d0
  388. .7        move.w    (a1)+,(a2)+
  389.         subq.w    #1,d0
  390.         bne    .7
  391.         sub.l    (lm_mem,LOC),a1
  392.         move.l    a1,(a0)+
  393.         subq.w    #1,d1
  394.         bne    .8
  395.         
  396.         movem.w    (bpl1mod,a3),d0-d1
  397.         lea    (bplpt,a3),a0
  398.         moveq    #4-1,d2
  399. .6        move.l    (a0),a1
  400.         add.w    d0,a1
  401.         add.w    (lm_widthskip,LOC),a1
  402.         move.l    a1,(a0)+
  403.         move.l    (a0),a1
  404.         add.w    d1,a1
  405.         add.w    (lm_widthskip,LOC),a1
  406.         move.l    a1,(a0)+
  407.         dbf    d2,.6
  408.         
  409.         subq.w    #1,d3
  410.         bne    .9
  411.  
  412.         move.l    d7,d0
  413.         move.l    (lm_destptr,LOC),a0
  414.         move.l    (gl_rdarray+aa_output,GL),d1
  415.         move.l    d1,a1
  416.         bsr    _SaveFileMsg
  417.  
  418.         move.l    (lm_destptr,LOC),a1
  419.         move.l    (gl_execbase,GL),a6
  420.         jsr    (_LVOFreeVec,a6)
  421. .adestfree
  422. .filefree
  423.         move.l    (lm_fileptr,LOC),a1
  424.         move.l    (gl_execbase,GL),a6
  425.         jsr    (_LVOFreeVec,a6)
  426. .afilefree
  427.         unlk    LOC
  428.         movem.l    (a7)+,d2-d7/a2-a3/a6
  429.         rts
  430.  
  431. ;##########################################################################
  432.  
  433. _cdis        moveq    #0,d4
  434.         move.l    (cop1lc,a3),d5        ;d5 = lc1
  435.         move.l    (cop2lc,a3),d6        ;d6 = lc2
  436.  
  437. .j1        move.l    d5,a0
  438. .nlc        addq.l    #1,d4
  439.         add.l    (lm_mem,LOC),a0
  440.         
  441.         move.l    d4,-(a7)
  442.         pea    (_copdump_text)
  443.         bsr    _pf
  444.         add.l    #8,a7
  445.  
  446. .next        bsr    _pa
  447.         cmp.l    #-2,(a0)
  448.         beq    .e
  449.         movem.w    (a0)+,d0-d1
  450.         btst    #0,d0
  451.         beq    .m
  452.         btst    #0,d1
  453.         beq    .w
  454.  
  455. .s        lsr.w    #1,d0
  456.         ext.l    d0
  457.         ror.l    #7,d0
  458.         lsl.w    #7,d0
  459.         lsr.l    #7,d0
  460.         move.l    d0,-(a7)
  461.         pea    .cskip
  462.         bsr    _pf
  463.         addq.l    #8,a7
  464.         bra    .next
  465.  
  466. .w        lsr.w    #1,d0
  467.         ext.l    d0
  468.         ror.l    #7,d0
  469.         lsl.w    #7,d0
  470.         lsr.l    #7,d0
  471.         move.l    d0,-(a7)
  472.         pea    .cwait
  473.         bsr    _pf
  474.         addq.l    #8,a7
  475.         bra    .next
  476.  
  477. .m        addq.w    #2,d0
  478.         cmp.w    (a0),d0
  479.         beq    .lm
  480.         subq.w    #2,d0
  481.         move.w    d0,-(a7)
  482.         move.w    d1,-(a7)
  483.         pea    .cmove
  484.         bsr    _pf
  485.         addq.l    #8,a7
  486.         bsr    _pc
  487.         cmp.w    #fmode,d0
  488.         bhi    .fail
  489.         cmp.w    #copjmp1,d0
  490.         beq    .j1
  491.         cmp.w    #copjmp2,d0
  492.         bne    .next
  493.         move.l    d6,a0
  494.         bra    .nlc
  495.  
  496. .lm        subq.w    #2,d0
  497.         addq.l    #2,a0
  498.         move.w    d0,d2
  499.         move.w    d1,d0
  500.         move.w    (a0)+,d1
  501.         movem.w    d0-d3,-(a7)
  502.         cmp.w    #cop1lc,d2
  503.         bne    .lm1
  504.         move.l    (a7),d5
  505. .lm1        cmp.w    #cop2lc,d2
  506.         bne    .lm2
  507.         move.l    (a7),d6
  508. .lm2        pea    .clmove
  509.         bsr    _pf
  510.         add.w    #12,a7
  511.         move.w    d2,d0
  512.         bsr    _pc
  513.         bra    .next
  514.  
  515. .e        pea    .cend
  516.         bsr    _p
  517.  
  518. .q        moveq    #-1,d0
  519.         rts
  520.  
  521. .fail        moveq    #0,d0
  522.         rts
  523.  
  524. .cend        dc.b    "CEND",10,0
  525. .cmove        dc.b    "CMOVE    #$%04x,$%04x    ",0
  526. .clmove        dc.b    "CLMOVE    #$%08lx,$%04x",0
  527. .cwait        dc.b    "CWAIT    %d,%d",10,0
  528. .cskip        dc.b    "CSKIP    %d,%d",10,0
  529.     EVEN
  530.  
  531. ;print address
  532. _pa        movem.l    d0-d1/a0-a1,-(a7)
  533.         sub.l    (lm_mem,LOC),a0
  534.         move.l    a0,-(a7)
  535.         pea    .1
  536.         bsr    _pf
  537.         addq.l    #8,a7
  538.         movem.l    (a7)+,_MOVEMREGS
  539.         rts
  540. .1        dc.b    "$%06lx ",0
  541.  
  542. ;print string
  543. _p        movem.l    d0-d1/a0-a1,-(a7)
  544.         move.l    (20,a7),a0
  545.         bsr    _PrintArgs
  546.         movem.l    (a7)+,_MOVEMREGS
  547.         rtd    #4
  548.  
  549. ;printf
  550. _pf        movem.l    d0-d1/a0-a1,-(a7)
  551.         move.l    (20,a7),a0
  552.         lea    (24,a7),a1
  553.         bsr    _PrintArgs
  554.         movem.l    (a7)+,_MOVEMREGS
  555.         rts
  556.  
  557. ;print custom
  558. _pc        movem.l    d0-d1/a0-a1,-(a7)
  559.         bsr    _GetCustomName
  560.         move.l    d0,-(a7)
  561.         pea    .2
  562.         bne    .1
  563.         addq.l    #4,a7
  564.         pea    .3
  565. .1        bsr    _pf
  566.         addq.l    #8,a7
  567.         movem.l    (a7)+,_MOVEMREGS
  568.         rts
  569.  
  570. .2        dc.b    "    ;%s"
  571. .3        dc.b    10,0
  572.     EVEN
  573.  
  574. ;##########################################################################
  575.  
  576. _copwrite    moveq    #-1,d5
  577.         move.l    (gl_rdarray+aa_copstop,GL),d0
  578.         beq    .cse
  579.         move.l    d0,a0
  580.         bsr    _etoi
  581.         move.l    d0,d5
  582.         add.l    (lm_mem,LOC),d5
  583. .cse
  584. .j1        move.l    (cop1lc,a3),a0
  585. .off        add.l    (lm_mem,LOC),a0
  586.  
  587. .c1n        cmp.l    #-2,(a0)
  588.         beq    .c1e
  589.         cmp.l    d5,a0
  590.         beq    .c1e
  591.         movem.w    (a0)+,d0-d1
  592.         btst    #0,d0
  593.         bne    .c1n
  594.         cmp.w    #copjmp1,d0
  595.         beq    .j1
  596.         cmp.w    #copjmp2,d0
  597.         bne    .c
  598.         move.l    (cop2lc,a3),a0
  599.         bra    .off
  600.         
  601. .c        cmp.w    #color,d0
  602.         blo    .c1u
  603.         cmp.w    #color+62,d0
  604.         bhi    .c1u
  605.  
  606.     ;color register
  607.         bfextu    (bplcon3,a3){0:3},d2    ;bank
  608.         mulu    #256/8*3,d2
  609.         lea    (lm_colors.w,LOC,d2.w),a1
  610.         sub.w    #color,d0
  611.         lsr.w    #1,d0
  612.         mulu    #3,d0
  613.         add.w    d0,a1
  614.         bfextu    d1{20:4},d2
  615.         mulu    #$11,d2
  616.         bfextu    d1{24:4},d3
  617.         mulu    #$11,d3
  618.         bfextu    d1{28:4},d4
  619.         mulu    #$11,d4
  620.         btst    #9,(bplcon3,a3)        ;LOCT ?
  621.         bne    .c1l
  622.         move.b    d2,(a1)+
  623.         move.b    d3,(a1)+
  624.         move.b    d4,(a1)
  625.         bra    .c1n
  626. .c1l        bfins    d2,(a1){4:4}
  627.         bfins    d3,(1,a1){4:4}
  628.         bfins    d4,(2,a1){4:4}
  629.         bra    .c1n
  630.  
  631. .c1u        move.w    d1,(a3,d0.w)
  632.         or.w    #$8080,($200.w,a3,d0.w)
  633.         bra    .c1n
  634. .c1e
  635.         rts
  636.  
  637. ;##########################################################################
  638.  
  639. _withargs
  640.         move.l    (gl_rdarray+aa_con0,GL),d0
  641.         beq    .0
  642.         move.l    d0,a0
  643.         bsr    _etoi
  644.         move.w    d0,(bplcon0,a3)
  645. .0
  646.         move.l    (gl_rdarray+aa_mod1,GL),d0
  647.         beq    .1
  648.         move.l    d0,a0
  649.         bsr    _etoi
  650.         move.w    d0,(bpl1mod,a3)
  651. .1        move.l    (gl_rdarray+aa_mod2,GL),d0
  652.         beq    .2
  653.         move.l    d0,a0
  654.         bsr    _etoi
  655.         move.w    d0,(bpl2mod,a3)
  656. .2
  657.         move.l    (gl_rdarray+aa_pt1,GL),d0
  658.         beq    .p1
  659.         move.l    d0,a0
  660.         bsr    _etoi
  661.         move.l    d0,(bplpt,a3)
  662. .p1        move.l    (gl_rdarray+aa_pt2,GL),d0
  663.         beq    .p2
  664.         move.l    d0,a0
  665.         bsr    _etoi
  666.         move.l    d0,(bplpt+4,a3)
  667. .p2        move.l    (gl_rdarray+aa_pt3,GL),d0
  668.         beq    .p3
  669.         move.l    d0,a0
  670.         bsr    _etoi
  671.         move.l    d0,(bplpt+8,a3)
  672. .p3        move.l    (gl_rdarray+aa_pt4,GL),d0
  673.         beq    .p4
  674.         move.l    d0,a0
  675.         bsr    _etoi
  676.         move.l    d0,(bplpt+12,a3)
  677. .p4
  678.         rts
  679.  
  680. ;##########################################################################
  681.  
  682.     INCDIR    Sources:
  683.     INCLUDE    dosio.i
  684.         PrintArgs
  685.         Print
  686.     INCLUDE    error.i
  687.         PrintErrorDOS
  688.     INCLUDE    files.i
  689.         LoadFileMsg
  690.         SaveFileMsg
  691.     INCLUDE    hardware.i
  692.         GetCustomName
  693.     INCLUDE    strings.i
  694.         etoi
  695.  
  696. ;##########################################################################
  697.  
  698. _name        dc.b    ".whdl_dump",0
  699.  
  700. _mem_text    dc.b    "BaseMemSize=$%lx",10,0
  701. _cop_text    dc.b    "cop1lc=$%lx cop2lc=$%lx",10,0
  702. _copdump_text    dc.b    "*** copperlist %ld ***",10,0
  703. _badci_text    dc.b    "bad copper instruction: %8lx",10,0
  704. _dim_text    dc.b    "width=%ld height=%ld depth=%ld",10,0
  705.  
  706. ; Errors
  707. _nomem        dc.b    "not enough free store",0
  708.  
  709. ; Operationen
  710. _readargs    dc.b    "read arguments",0
  711.  
  712. ;subsystems
  713. _dosname    dc.b    "dos.library",0
  714.  
  715. _template    dc.b    "OutputFile/A"
  716.         dc.b    ",Cop/K"
  717.         dc.b    ",CS=CopStop/K"
  718.         dc.b    ",Width/K"
  719.         dc.b    ",Height/K"
  720.         dc.b    ",con0/K"
  721.         dc.b    ",mod1/K"
  722.         dc.b    ",mod2/K"
  723.         dc.b    ",pt1/K"
  724.         dc.b    ",pt2/K"
  725.         dc.b    ",pt3/K"
  726.         dc.b    ",pt4/K"
  727.         dc.b    0
  728.  
  729. _ver        VER
  730.         dc.b    10,0
  731.  
  732. ;##########################################################################
  733.  
  734.     END
  735.  
  736.